package com.beesphere.products.throttling;

import java.io.Serializable;

/**
 * The callback interface for an {@link AsyncProcessor} so that it can
 * notify you when an {@link UnitOfWork} has completed. 
 */
public interface AsyncCallback extends Serializable {
    
    /**
     * This method is invoked once the UnitOfWork is completed.  If an error 
     * occurred while processing the UnitOfWork, the exception field of the 
     * {@link UnitOfWork} being processed will hold the error. 
     *  
     * @param doneSynchronously set to true if the processing of the exchange was completed synchronously thread.
     */
    void done (Object unitOfWorkResult, boolean doneSynchronously);    
    
}
